package sys.controller;


import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import sys.entity.Dto;
import sys.entity.Student;
import sys.entity.Teacher;
import sys.service.StudentService;
import sys.service.TeaService;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("tea")
public class TeaController {

   @Autowired
   private TeaService teaService;

    @PostMapping("findPageTea")
    public PageInfo findPageTea(Integer pageIndex, @RequestBody Map serachMap) {
        return teaService.findPageTea(pageIndex, serachMap);
    }

    @RequestMapping("findPages")
    public PageInfo findPage(Integer pageIndex, @RequestBody Map serachMap) {
        return teaService.findPage(pageIndex, serachMap);
    }

    @RequestMapping("add")
    public void add(@RequestBody Teacher teacher) {
        teaService.add(teacher);
    }

}
